package org.format;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

public class FormatDate1 {
    public static void main(String[] args) {

        var sd3 = new SimpleDateFormat("F W");
        System.out.println(sd3.format(System.currentTimeMillis()));

        //Locale.setDefault(Locale.US);

        //格式化日期 y 4  yy 2 yyyyy 02023 M 6 MM 06 MMM 6月 MMMM六月
        var sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒 S毫秒 E EEEE MMM MMMM a");
        System.out.println(sdf.format(System.currentTimeMillis()));

        var sd2 = new SimpleDateFormat("yyyyMMddHHmmssS");
        System.out.println(sd2.format(System.currentTimeMillis())+".jpg");


        System.out.println();
        System.out.println("-------------------------------------");
        //格式化日期
        long time = System.currentTimeMillis();
        System.out.println(time);
        System.out.printf("秒:%ts  毫秒:%<tQ%n",time);

        Calendar c = Calendar.getInstance();
        System.out.printf("秒:%ts  毫秒:%<tQ%n",c);

        System.out.printf("%tY年%<tm月%<td日 %<tH时%<tM分%<tS秒%<tL毫秒 %<tB %<tA %<tp %n",c);
        System.out.printf("%tY年%<tm月%<td日 %<tH时%<tM分%<tS秒%<tL毫秒 %<tB %<tA %<tp %n",c);

        //20230609100122324.jpg  user.jpg

        //20230609100252901.jpg
        String fn = String.format("%tY%<tm%<td%<tH%<tM%<tS%<tL.jpg",System.currentTimeMillis());
        System.out.println(fn);




    }
}
